#!/usr/bin/perl
use Net::Smtp;


$smtp_server = 'smtp.nokia.com';

$from = 'mape2emonitoring_SVC_BE@nokia.com';

$title = 'Test Mail';

$delay = 1;

$to = 'ext-duan.ken@nokia.com';


$msg=<<EOF;
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>
EOF

print "I am sending Email \n";
&gingerMail($smtp_server,$from,$to,$title,$msg);
print "Email has been sent to: ".$to."\n";
print "\n......Finished!!!";


sub gingerMail{ 
my($smtp_server,$from,$to,$title,$msg) = @_;
$smtp = Net::SMTP->new($smtp_server);

#$smtp->auth('sleetdrop','xxxxxxxxx');
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend('From: '.$from);
$smtp->datasend("\n");
$smtp->datasend('To: '.$to);
$smtp->datasend("\n");
$smtp->datasend('Subject: '.$title);
$smtp->datasend("\n\n");
$smtp->datasend("$msg\n");
$smtp->dataend();
$smtp->quit;
}